<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="com.ubst.smartad.common.*" %>
<%@page import="com.ubst.smartad.env.*" %>
<%@page import="com.ubst.smartad.session.*" %>
<%@page import="com.ubst.smartad.logger.Debug" %>
<%@page import="net.sf.json.JSONArray"  %>
<%@page import="net.sf.json.JSONObject"  %>
<%@page import="java.util.HashMap" %>
<%@page import="java.util.ArrayList" %>
<%@page import="java.util.List" %>
<%@page import="java.io.PrintWriter" %>
<%@page import="com.ubst.smartad.dbpool.TransactionManager" %>
<%@page import="com.ubst.smartad.impl.admin.status.StatusMngImpl" %>
<%@include file="/jsp/inc/base.jsp"%>

<jsp:useBean id="tem" class="com.ubst.smartad.template.Template" scope="page"/>
<% 
// tem.setFileText( web_root+"skin1/test/test.html");
// tem.setReplaceKey("{TEST}", "aabbcc");

try{
// 	System.out.println("request.getParameterMap() "+request.getParameterMap());
// 	System.out.println("sord "+request.getParameter("sord"));
// 	System.out.println("page "+request.getParameter("page"));
// 	System.out.println("nd "+request.getParameter("nd"));
// 	System.out.println("sidx "+request.getParameter("sidx"));
// 	System.out.println("search "+request.getParameter("search"));
// 	System.out.println("rows "+request.getParameter("rows"));
// 	System.out.println("pagePlug "+request.getParameter("pagePlug"));
	
	//search: selectbox에 있는 search 조건값들
	// 	System.out.println("sel_pw "+request.getParameter("sel_pw"));
	// 	System.out.println("txt_1 "+request.getParameter("txt_1"));
	// 	System.out.println("txt_2 "+request.getParameter("txt_2"));
	// 	System.out.println("txt_3 "+request.getParameter("txt_3"));
	// 	System.out.println("sel_array "+request.getParameter("sel_array"));
	// 	System.out.println("sel_log "+request.getParameter("sel_log"));
	// orderBy와 searchStr에 해당값 세팅
	String orderBy = request.getParameter("sidx")+" "+request.getParameter("sord");//sort할 필드명,	sort 오름차내림차 
	String searchStr = request.getParameter("search");								//	search할 str
	
	/*
	*	setting
	*
	*//////////////////

	StatusMngImpl statusMng = null;
	TransactionManager tm = new TransactionManager();
	
	statusMng = new StatusMngImpl(tm.connection, serverName, fhostEnv.getLogLevel());
	List list = statusMng.getJqgridAccount2List(searchStr, orderBy);// list 가져오기

	JSONArray jsonArr = JSONArray.fromObject(list);
	JSONObject jsonObj = new JSONObject();
	jsonObj.put("rows", jsonArr);		// Data
	
	response.setContentType("text/plain; charset=utf-8"); 
	response.setHeader("Cache-Control", "no-cache"); 
	//PrintWriter out = response.getWriter();
	out.print(jsonObj.toString());
	System.out.println("jsonObj.toString() "+jsonObj.toString());
	out.flush();
}catch (Exception e) {			
}

%>
				